import {
	commitBeforeMutationEffects,
	commitMutationEffects,
	commitLayoutEffects,
} from './ReactFiberCommitWork.new'
function commitRootImpl() {
	let BeforeMutationMask = Update | Snapshot
	let MutationMask =
		Placement | Update | ChildDeletion | ContentReset | Visibility | Ref
	let LayoutMask = Update | Callback | Ref | Visibility
	/* useEffect 标志 */
	let PassiveMask = Passive | ChildDeletion
	if (
		(finishedWork.subtreeFlags & PassiveMask) !== NoFlags ||
		(finishedWork.flags & PassiveMask) !== NoFlags
	) {
		/* 通过异步的方式处理 useEffect */
		scheduleCallbck$1(NormalPriority, () => {
			flushPassiveEffects()
			return null
		})
	}

	/* beforeMutation 阶段 */
	const text = document.getElementById('text')
	/* beforeMutation 执行 */
	commitBeforeMutationEffects(root, finishedWork)
	/* beforeMutation 执行完毕 mutation 阶段执行 */
	commitMutationEffects(root, finishedWork, lanes)
	/* mutation 阶段执行完毕 layout 阶段开始 */
	commitLayoutEffects(finishedWork, root, lanes)
	/* layout 执行完毕 */
}
